#include "stdafx.h"
#include "Fakes/FakeD3D11Device.h"
#include "Fakes/FakeD3D11Counter.h"

DESCRIPTION_11_TEST_SUITE_CTOR(CounterDescription, (D3D11_COUNTER_DEVICE_DEPENDENT_0))

BOOST_FIXTURE_TEST_CASE(Default, TestCounterDescription)
{
	BOOST_REQUIRE_EQUAL(D3D11_COUNTER_DEVICE_DEPENDENT_0, m_desc.Counter);
	BOOST_REQUIRE_EQUAL(0, m_desc.MiscFlags);
}

DESCRIPTION_11_SETTER_TEST_CASE(UINT, MiscFlags, 1, CounterDescription)

BOOST_FIXTURE_TEST_CASE(Create, TestCounterDescription)
{
	FakeD3D11Device device;
	FakeD3D11Counter counter;
	device.CreateCounterFakeResult = &counter;
	device.CreateCounterFakeHResult = S_OK;
	ID3D11Counter *result = m_desc.Create(&device);
	BOOST_REQUIRE(device.CreateCounterCalled);
	BOOST_REQUIRE_EQUAL(&counter, result);
	BOOST_REQUIRE_EQUAL(&m_desc, device.CreateCounterLastDesc);
}

BOOST_AUTO_TEST_SUITE_END()
